package com.homepage.service.mapper;

import com.homepage.domain.Featurette;
import com.homepage.service.dto.FeaturetteDTO;
import org.mapstruct.BeanMapping;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Named;

/**
 * Mapper for the entity {@link Featurette} and its DTO {@link FeaturetteDTO}.
 */
@Mapper(componentModel = "spring", uses = { CompanyMapper.class })
public interface FeaturetteMapper extends EntityMapper<FeaturetteDTO, Featurette> {

    @Mapping(target = "company.id", source = "companyId")
    Featurette toEntity(FeaturetteDTO dto);

    @Mapping(target = "companyId", source = "company.id")
    FeaturetteDTO toDto(Featurette entity);
    @Named("id")
    @BeanMapping(ignoreByDefault = true)
    @Mapping(target = "id", source = "id")
    FeaturetteDTO toDtoId(Featurette featurette);
}
